/*
 * Copyright (c) 2016- 2020 qolome.com Inc. All Rights Reserved.
 * ProjectName: qolome-knowledge
 * FileName: Test.java
 * Author: jiangfeng@qolome.com
 * Date: 2020/3/1 下午4:21
 * LastModified: 2020/03/01 16:21:01
 */

package com.qolome.knowledge.design.pattern.prototype.demo;

import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Qolome
 * @version V1.0
 * @Description 测试
 * @date 2020年 03月01日 16:21:05
 */
@Slf4j
public class Test {

    public static void main(String[] args) throws JsonProcessingException {

        List<Car> cars = new ArrayList<>();
        cars.add(new Car("奔驰"));
        cars.add(new Car("宝马"));
        cars.add(new Car("奥迪"));
        User user = User
                .builder()
                .id(123L)
                .name("张三")
                .cars(cars)
                .build();
        log.info("user:{}",user);
        User user1 = CloneUtils.deepClone(user);
        log.info("user1:{}",user1);
        System.out.println(user==user1);

    }
}
